package com.toweave.starter.activity;

import static com.toweave.starter.utils.ConstantsUtil.LIZ_TAG;

import androidx.appcompat.app.AppCompatActivity;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

import com.toweave.starter.AsApplication;
import com.toweave.starter.R;

import java.util.Locale;

public class TextViewActivity extends AppCompatActivity {

  private TextView tv_display_density;

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_text_view);

    tv_display_density = findViewById(R.id.tv_display_density);
  }

  @Override
  protected void onStart() {
    super.onStart();
    AsApplication app = (AsApplication) getApplicationContext();
    float density = app.getDensity();
    String sDensity = String.format(Locale.CHINA, "density: %f", density);
    Log.i(LIZ_TAG, sDensity);
    tv_display_density.setText(sDensity);
  }
}